package com.poorstu.dao.impl;

import java.util.List;

import com.common.base.dao.impl.BaseDaoImpl;
import com.poorstu.dao.ClassAndCollegeDao;
import com.poorstu.model.ClassMod;
import com.poorstu.model.CollegeMod;

public class ClassAndCollegeDaoImpl extends BaseDaoImpl implements ClassAndCollegeDao {

	public List<CollegeMod> selectCollegeAll() {
		
		return super.findAll("CollegeMod");
	}

	public List<ClassMod> selectClassByColId(int collegeId) {
		try{
		return super.findByHql("from ClassMod where collegeId="+collegeId);
		}catch(Exception e){
		e.printStackTrace();
		return null;
		}
	}

	public ClassMod selectClassById(int classId) {
		
		ClassMod classMod=(ClassMod)(super.findByHql("from ClassMod where classId="+classId)).get(0);
	    
		return classMod;
	}
	
	
}
